require 'bundler/setup'
require 'helix_runtime/build_task'
require 'rspec/core/rake_task'
require_relative '../shared.rb'

# For Windows
$stdout.sync = true

HelixRuntime::BuildTask.new do |t|
  t.build_root = File.expand_path("../..", __dir__)
  t.helix_lib_dir = File.expand_path("../../ruby/windows_build", __dir__)
  t.pre_build = HelixRuntime::Tests.pre_build
end

task :benchmark => :build do
  exec "ruby -Ilib benchmark.rb"
end

RSpec::Core::RakeTask.new(:spec) do |t|
  t.verbose = false
end

task :spec => :build

task "spec:all" do
  ['RUST', 'FAST_RUBY', 'NAIVE_RUBY'].each do |impl|
    sh({ 'IMPLEMENTATION' => impl }, 'rake spec')
  end
end

task :default => "spec:all"
